const app = getApp();

var data = {
  xhx_images: app.xhx_images,
  xhx_route: app.xhx_route,
};

var currentPage = {
  data,
  onLoad,
  getDetails,
};

var page = Object.assign({}, currentPage);

Page(page);

function onLoad(options) {
  const that = this;
  const type = options && options.type || 1;
  const index = options && options.index || 1;
  let title = "活动公告";
  if (type == 2) {
    title = "平台通知";
  }
  wx.setNavigationBarTitle({
    title,
  })

  that.getDetails(index);
}

function getDetails(index){
  const that = this;
  let prevPage = getCurrentPages()[getCurrentPages().length-2];
  that.setData({
    article: prevPage.data.lists[index].content
  })
}